package com.hudson.plugin.result.collector.server.datastore.dao;

import com.hudson.plugin.result.collector.server.datastore.dao.exceptions.NonexistentEntityException;
import com.hudson.plugin.result.collector.server.datastore.dao.exceptions.PreexistingEntityException;
import com.hudson.plugin.result.collector.server.datastore.internal.entity.BuildRelationsEntity;

import javax.persistence.EntityManager;
import java.util.List;

/**
 * User: yuxinlei
 * Date: 5/24/11
 * Time: 1:20 PM
 */
public interface BuildRelationsEntityJpaController {
    EntityManager getEntityManager();

    void create(BuildRelationsEntity buildRelationsEntity) throws PreexistingEntityException, Exception;

    void edit(BuildRelationsEntity buildRelationsEntity) throws NonexistentEntityException, Exception;

    void destroy(int id) throws NonexistentEntityException;

    BuildRelationsEntity findBuildRelationsEntity(int id);

    List<Integer> findParentIdByChildId(Integer childId);
}
